package xkp.lesson2;

public class TestException {
	public static void main(String[] args) {
		//此处如果发生异常，我们其实根本没做处理，最终该异常会被JVM虚拟机处理
		//int n = 10/0;
		//该行代码必须要做异常处理
		//InputStream inputStream = new FileInputStream("");
		try {
			int n = 10/0;
		}catch (NullPointerException e) {
			System.out.println("空指针异常");
		}catch (ArithmeticException e) {
			System.out.println("除数不能为0");
		}finally {
			System.out.println("我不管异常有没有被捕捉到，我铁定执行");
		}
		//int n = 10/0;
		System.out.println("------------------------------");
		
	}

}
